/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package project.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author armen
 */
@Entity
@Table(name = "newfeed")
public class NewFeedEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Lob
    @Column(name = "url")
    private String url;
    @Lob
    @Column(name = "subject")
    private String subject;
    @Lob
    @Column(name = "content")
    private String content;
    @Lob
    @Column(name = "media")
    private String media;
    @Column(name = "datePulished")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datePulished;

    public NewFeedEntity() {
    }

    public NewFeedEntity(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMedia() {
        return media;
    }

    public void setMedia(String media) {
        this.media = media;
    }

    public Date getDatePulished() {
        return datePulished;
    }

    public void setDatePulished(Date datePulished) {
        this.datePulished = datePulished;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewFeedEntity)) {
            return false;
        }
        NewFeedEntity other = (NewFeedEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "project.entities.Newfeed[id=" + id + "]";
    }

}
